import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/homes'
  },

//客户关怀
{
  path: '/careuser',
  name: 'CareUser',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "about" */ '../views/CareUser/CareUser.vue')
},
//新增用户
{
  path: '/newuser',
  name: 'NewUser',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "about" */ '@/views/NewUser/newuser.vue')
},
{
  path: '/userlist',
  name: 'UserList',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "about" */ '@/views/UserList/userlist.vue')
},
{
  path: '/homes',
  name: 'Homes',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import( /* webpackChunkName: "about" */ '../views/Home/Home.vue')
},
{
  path: '/login',
  name: 'Login',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "login" */ '../views/Login/Login.vue')
},

//客户管理之客户查询页/搜索,做首页的人直接在点击我的客户跳转到下面这个路由
{
  path: '/searchCustomer',
  name: 'SearchCustomer',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "searchCustomer" */ '../views/CustomerPage/SearchCustomer.vue')
},
//客户收入分析
{
  path: '/income',
  name: 'Income',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "income" */ '../views/CustomerPage/Income .vue')
},
{
  path: '/reg',
  name: 'Reg',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "about" */ '../views/Register/Register.vue')
},
{
  path: '/order',
  name: 'Order',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "about" */ '../views/OrderList/OrderList.vue')
},
// {
//   path: '/about',
//   name: 'About',
//   // route level code-splitting
//   // this generates a separate chunk (about.[hash].js) for this route
//   // which is lazy-loaded when the route is visited.
//   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
// }
// 个人中心
{
  path: '/personal',
  name: 'Personal',
  component: () => import('@/views/Personal/Personal.vue'),
},
// 个人信息
{
  path: "/userInfo",
  name: "UserInfo",
  component: () => import('@/views/Personal/UserInfo.vue'),
}

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router